# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=perl-io-compress-brotli
epoch=1
pkgver=0.008
pkgrel=1
pkgdesc='Read/write Brotli buffers/streams'
url="https://metacpan.org/release/IO-Compress-Brotli"
arch=('loong64' 'x86_64')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl' 'brotli' 'perl-file-slurper')
source=("https://search.cpan.org/CPAN/authors/id/T/TI/TIMLEGGE/IO-Compress-Brotli-$pkgver.tar.gz"
        use-system-brotli.patch)
sha512sums=('f70228cd763dde5905f686d81d8a3d887b06add69ecee515037dfa48e7a186c226312618467999b9fff587b4d2adac2a2501148b8789659b1624e3a8384d490e'
            'a6bd9717d13634596f716c407dc46b9f69cc2f80c07ad9281b667f6ebc67937f333de423381655cb521dd4cae2e0f4b4b1e4fd406573f3a8acb7874e9e060195')

prepare() {
  cd IO-Compress-Brotli-$pkgver
  patch -p0 -i ../use-system-brotli.patch
}

build() {
  cd IO-Compress-Brotli-$pkgver
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd IO-Compress-Brotli-$pkgver
  make test
}

package() {
  cd IO-Compress-Brotli-$pkgver
  make install DESTDIR="$pkgdir"
}

# vim:set ts=2 sw=2 et:
